import { Tabs,  Col, Row, Radio ,DatePicker ,Select,Badge ,Divider,Button,Card,Image,Pagination,Space } from 'antd';

import React, { useState} from 'react';

import BarChart from '../../energyAnalysis/components/barChart';

var moment = require('moment');
import cloneDeep from 'lodash.clonedeep';
const { Option } = Select;

const DeviceNameA: React.FC = () => {

  function random(min, max) {
 
    return Math.floor(Math.random() * (max - min)) + min;
   
  }

  var dataAxis = [];
var data = [];
var date=new Date()
for(let i=1;i<1000;i++){
   if(i==700){
    data.push(20);
  }else{
    data.push(i%2==0? random(90, 100): random(110, 120));
  }
  

  dataAxis.push((moment(date).add(i, 'minutes')).format("YYYY-MM-DD hh:mm:ss.SSS"));
}
var name="实时数据";
var chart={
  dataAxis:dataAxis,
  data:data,
  name:name,
  type:'line',
  
  yname:'Amp'
}

  
const [charOption, setChartOption] = useState(chart);
const [shuosuostate, setShuosuostate] = useState(0);




    return (
      <>
              <BarChart charOption={charOption} style={{ height: 400, width: '100%',marginBottom:20 }} />
     
      </>
    );
};

export default DeviceNameA;